//学科评估
<template>
  <div class="module_">
    <div class="mb8">
      <search @clearSearch='clearSearch'>
        <el-form label-width='60px' inline autocomplete="off" :model="pageparm" class="search_box">
          <el-form-item label="姓名">
            <el-input size="medium"  clearable v-model="editForm.phone"  placeholder="请输入姓名搜索" />
          </el-form-item>
          <el-form-item label="状态">
            <el-input size="medium"  clearable v-model="editForm.phone"  placeholder="请选择状态筛选" />
          </el-form-item>
        </el-form>
        <template slot="footer">
          <el-button size="medium" type="primary" @click="handle({},1)">添加</el-button>
        </template>
      </search>
    </div>
    <el-table :data="tableData" class="flex-1" height="100%" size="medium" border highlight-current-row
      v-loading="tableLoading" stripe @sort-change="tableSortChange">
      <el-table-column align="center" show-overflow-tooltip prop="name" label="姓名" width="150" sortable="custom">
      </el-table-column>
      <el-table-column align="center" show-overflow-tooltip prop="status" label="状态" width="150" sortable="custom">
      </el-table-column>
      <el-table-column align="center" show-overflow-tooltip prop="zhiwei" label="职位" width="150" sortable="custom">
      </el-table-column>
      <el-table-column align="center" show-overflow-tooltip prop="phone" label="电话" width="150" sortable="custom">
      </el-table-column>
      <el-table-column align="center" label="操作" width="150">
        <div class="flex-justify-end" slot-scope="scope">
          <el-tooltip effect="dark" content="审核" placement="bottom-end">
            <el-button type="primary" v-if="scope.row.status === '未审核'"
              @click="examine_btns(scope.row,1)" size="small" icon="el-icon-help" circle></el-button>
          </el-tooltip>
          <el-tooltip effect="dark" content="修改信息" placement="bottom-end">
            <el-button size="small" @click="handle(scope.row,2)" icon="el-icon-edit" circle></el-button>
          </el-tooltip>
          <el-tooltip effect="dark" content="删除" placement="bottom-end">
            <el-button size="small" type="danger" icon="el-icon-delete" circle></el-button>
          </el-tooltip>
        </div>
      </el-table-column>
    </el-table>

    <Pagination v-bind:child-msg="pageparm" @callFather="callFather"></Pagination>

    <el-dialog :visible.sync="editFormVisible" width="400px"  :close-on-click-modal='false'
      :close-on-press-escape='false'>
      <el-form autocomplete="off" label-width="60px" class="form_flex">
        <el-form-item label="姓名" class="tip">
          <el-input size="medium"  clearable v-model="editForm.name"  placeholder="请选择人员" />
        </el-form-item>
        <el-form-item label="职位" class="tip">
          <el-input size="medium"  clearable v-model="editForm.zhiwei"  placeholder="请输入职位" />
        </el-form-item>
        <el-form-item label="电话" class="tip">
          <el-input size="medium"  clearable v-model="editForm.phone"  placeholder="请输入电话" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="flex-justify-bcenter">
        <el-button @click="editFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="submit" :loading='btnLoading'>确 定</el-button>
      </div>
    </el-dialog>

     <!-- 审核 -->
    <examine ref="examine" @submit='(options)=>examineSubmit(options,1)' />
  </div>
</template>

<script>
  export default {
    data() {
      return {
        tableData: [{
          name:'乙',
          status:'未审核',
          zhiwei:'职位5',
          phone: 13399999999
        },{
          name:'张三',
          status:'审核通过',
          zhiwei:'职位1',
          phone: 13311112222
        },{
          name:'李四',
          status:'审核通过',
          zhiwei:'职位2',
          phone: 13333334444
        },{
          name:'王五',
          status:'审核通过',
          zhiwei:'职位3',
          phone: 13355556666
        },{
          name:'甲',
          status:'审核通过',
          zhiwei:'职位4',
          phone: 13377778888
        },],
        editFormVisible: false,
        editForm: {}, //修改或者查看详情

        pageparm: {
          page: 1,
          perPage: 20,
          total: null,
          sort_str: null,
          sort_order: 'desc',
        },
        tableLoading: false,

        btnLoading: false,

        dialogTitle: '',

      }
    },
    mounted() {
    },
    methods: {
      handle(item,i){
        this.editForm = {...item}
        this.editFormVisible = true
      },
      examineSubmit(){

      },
      examine_btns(item, i) {
        this.$refs.examine.examineShow = true
      },
      tableSortChange(column) {
        if (column.order === "descending") {
          this.pageparm.sort_str = column.prop;
          this.pageparm.sort_order = "desc";
        } else if (column.order === "ascending") {
          this.pageparm.sort_str = column.prop;
          this.pageparm.sort_order = "asc";
        } else {
          this.pageparm.sort_str = null;
          this.pageparm.sort_order = null;
        }
        this.getList()
      },
      //搜索
      clearSearch() {
        // this.$refs.search_d.clear()
      },
      searchChane(i, val) {
        this.pageparm[val] = i
        this.pageparm.page = 1
        this.getList()
      },
      //分页
      callFather(pageparm) {
        this.pageparm.page = pageparm.page
        this.pageparm.perPage = pageparm.perPage
        this.getList()
      },
      getList() {
        this.tableLoading = true
        Apievaluatetask(this.pageparm).then(({
          data,
          page
        }) => {
          this.tableData = data || []
          this.pageparm.total = page.total
          this.tableLoading = false
        }).catch(() => {
          this.tableLoading = false
        })
      },
      submit(){

      }
    },

  }
</script>
